//
//  HJUser.m
//  newOcWeibo
//
//  Created by heJing on 15/7/28.
//  Copyright © 2015年 heima. All rights reserved.
//

#import "HJUser.h"

@implementation HJUser

- (BOOL)isVip
{
    return self.mbtype > 2;
}

- (UIImage *)vipImage
{
    UIImage *image = nil;
    if ([self isVip]) {
        NSString *vipImageName = [NSString stringWithFormat:@"common_icon_membership_level%d", self.mbrank];
        image = [UIImage imageNamed:vipImageName];
    }
    return image;
}

- (UIImage *)verifiedImage
{
    NSString *verifiedImageNaem = nil;
    switch (self.verified_type) {
        case 0: // 个人认证
            verifiedImageNaem = @"avatar_vip";
            break;
        case 2: // 企业认证
        case 3:
        case 5:
            verifiedImageNaem = @"avatar_enterprise_vip";
            break;
        case 220: // 微博达人
            verifiedImageNaem = @"avatar_grassroot";
            break;
            
        default:
            // 没有认证
            break;
    }
    if ([verifiedImageNaem isEqualToString:@""] || verifiedImageNaem == nil) {
        return nil;
    }
    return [UIImage imageNamed:verifiedImageNaem];
}
@end
